<html>
<head><meta charset="utf-8"><title>mysterious code: borrowed value seems to live too long · t-compiler/wg-nll · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/index.html">t-compiler/wg-nll</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html">mysterious code: borrowed value seems to live too long</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="130699087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130699087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130699087">(Aug 01 2018 at 07:56)</a>:</h4>
<p>Hello.<br>
I might have found compiler issue around borrow checker, but I'm not sure this is a bug or intended behavior, so I report (and ask) it here.</p>
<p>Code:<br>
<a href="https://play.rust-lang.org/?gist=3fe95bb18c586e411fc8bdea957a869f&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=3fe95bb18c586e411fc8bdea957a869f&amp;version=nightly&amp;mode=debug&amp;edition=2015">https://play.rust-lang.org/?gist=3fe95bb18c586e411fc8bdea957a869f&amp;version=nightly&amp;mode=debug&amp;edition=2015</a></p>
<p>Usage:</p>
<ul>
<li>Try with NLL enabled and disabled.</li>
<li>Uncomment ones from (1a -- 1b), (2a -- 2b), (3a -- 3c) respectively.<ul>
<li>e.g. uncomment (1a), (2a), (3a) / uncomment (1b), (2a), (3c) / ...</li>
</ul>
</li>
</ul>
<p>Problematic cases:</p>
<ul>
<li>If none of (1b) and (2b) is not uncommented, the code does not compile no matter whether NLL is enabled or not.</li>
<li>If (1a), (2a), and (3b) is uncommented,<ul>
<li>it compiles with NLL disabled, but</li>
<li>does not compile with NLL enabled.</li>
</ul>
</li>
</ul>
<p>Error message example of (1a), (2a), and (3a), with NLL enabled:</p>
<div class="codehilite"><pre><span></span>warning: unused variable: `b`
  --&gt; src/main.rs:33:21
   |
33 |                 let b: &amp;B = (*owned).borrow(); // (3a)
   |                     ^ help: consider using `_b` instead
   |
   = note: #[warn(unused_variables)] on by default

error: unsatisfied lifetime constraints
  --&gt; src/main.rs:33:29
   |
27 |     pub fn to_shared(&amp;self) -&gt; Arc&lt;B&gt; { // (2a) does not compile.
   |                      - let&#39;s call the lifetime of this reference `&#39;1`
...
33 |                 let b: &amp;B = (*owned).borrow(); // (3a)
   |                             ^^^^^^^^^^^^^^^^^ requires that `&#39;1` must outlive `&#39;a`

error: aborting due to previous error
</pre></div>


<p>Question:</p>
<ul>
<li>(q1) Are these errors intended, or compiler bug?<ul>
<li>It feels intuitively wrong for me, but I'm not sure...</li>
</ul>
</li>
<li>(q2) If these are intended,<ul>
<li>(q2-1) Why <code>(*owned).borrow()</code> outlives <code>to_shared()</code> function?</li>
<li>(q2-2) Why unused <code>Into&lt;Arc&lt;B&gt;&gt;</code> trait bound cause or prevent the compilation error?</li>
</ul>
</li>
</ul>
<p>Thank you.</p>



<a name="130711867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130711867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130711867">(Aug 01 2018 at 12:59)</a>:</h4>
<p>That's a lot of permutations that you are asking about...</p>
<p>Let's start with some easy questions as I wake up:</p>
<p>1. Why are you doing (<code>(*owned).borrow()</code>) instead of <code>owned.borrow()</code><br>
2. Why are there no trait bounds that use <code>Borrow</code>?</p>



<a name="130713804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130713804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130713804">(Aug 01 2018 at 13:31)</a>:</h4>
<p>1. It doesn't need to be <code>(*owned).borrow()</code>. <code>owned.borrow()</code> causes the same error.<br>
  (I've tried some code variations to avoid this error, and explicit deref is one of them.)<br>
2. I didn't specify <code>Borrow&lt;B&gt;</code> bound explilitly, because <code>Owned</code> variant has <code>&lt;B as ToOwned&gt;::Owned</code> field, and <code>B: ToOwned</code> requires <code>&lt;B as ToOwned&gt;::Owned: Borrow&lt;B&gt;</code>.<br>
  (<a href="https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#associatedtype.Owned" target="_blank" title="https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#associatedtype.Owned">https://doc.rust-lang.org/std/borrow/trait.ToOwned.html#associatedtype.Owned</a>)</p>



<a name="130714190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130714190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130714190">(Aug 01 2018 at 13:37)</a>:</h4>
<p>My first thoughts on <code>let _: &amp;B = owned.borrow();</code> is that there's a <em>possibility</em> of that being an NLL difference. The <code>_</code> pattern is special and acts as if you didn't bind anything. It's <em>possible</em> that NLL doesn't know / care about it and is always giving you the error</p>



<a name="130714344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130714344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130714344">(Aug 01 2018 at 13:40)</a>:</h4>
<p>If true, seems like something that could be tested with a smaller / simpler case</p>



<a name="130715836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130715836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130715836">(Aug 01 2018 at 14:02)</a>:</h4>
<p>Ok, created smaller cases.<br>
I think two cases below are almost same.</p>
<p>toplevel-fn ver.: <a href="https://play.rust-lang.org/?gist=8fd178829fb82b2e02bfe0ec7edcd419&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=8fd178829fb82b2e02bfe0ec7edcd419&amp;version=nightly&amp;mode=debug&amp;edition=2015">https://play.rust-lang.org/?gist=8fd178829fb82b2e02bfe0ec7edcd419&amp;version=nightly&amp;mode=debug&amp;edition=2015</a><br>
impl ver.: <a href="https://play.rust-lang.org/?gist=ea53abfa145a2ec7f2462e9b14866f51&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=ea53abfa145a2ec7f2462e9b14866f51&amp;version=nightly&amp;mode=debug&amp;edition=2015">https://play.rust-lang.org/?gist=ea53abfa145a2ec7f2462e9b14866f51&amp;version=nightly&amp;mode=debug&amp;edition=2015</a></p>
<p>A case to see NLL difference: <a href="https://play.rust-lang.org/?gist=7c4ecdbf2500e3241c5fdfa667643612&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=7c4ecdbf2500e3241c5fdfa667643612&amp;version=nightly&amp;mode=debug&amp;edition=2015">https://play.rust-lang.org/?gist=7c4ecdbf2500e3241c5fdfa667643612&amp;version=nightly&amp;mode=debug&amp;edition=2015</a></p>
<p>code (NLL difference ver, 7c4e...):</p>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(nll)]</span><span class="w"></span>

<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">borrow</span>::<span class="n">Borrow</span><span class="p">;</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">sync</span>::<span class="n">Arc</span><span class="p">;</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">OwnedWrap</span><span class="o">&lt;</span><span class="n">B</span>: <span class="nb">ToOwned</span> <span class="o">+</span><span class="w"> </span><span class="o">?</span><span class="nb">Sized</span><span class="o">&gt;</span><span class="p">(</span><span class="o">&lt;</span><span class="n">B</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nb">ToOwned</span><span class="o">&gt;</span>::<span class="n">Owned</span><span class="p">);</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">to_arc</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="p">,</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="p">(</span><span class="n">wrap</span>: <span class="kp">&amp;</span><span class="nc">OwnedWrap</span><span class="o">&lt;</span><span class="n">B</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Arc</span><span class="o">&lt;</span><span class="n">B</span><span class="o">&gt;</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">B</span>: <span class="na">&#39;a</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">ToOwned</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="o">?</span><span class="nb">Sized</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">B</span>: <span class="nb">Into</span><span class="o">&lt;</span><span class="n">Arc</span><span class="o">&lt;</span><span class="n">B</span><span class="o">&gt;&gt;</span><span class="p">,</span><span class="w"> </span><span class="c1">// (1a)</span>
<span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">OwnedWrap</span><span class="p">(</span><span class="k">ref</span><span class="w"> </span><span class="n">owned</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">wrap</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span>: <span class="kp">&amp;</span><span class="nc">B</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="o">*</span><span class="n">owned</span><span class="p">).</span><span class="n">borrow</span><span class="p">();</span><span class="w"> </span><span class="c1">// (3b)</span>
<span class="w">        </span><span class="n">unimplemented</span><span class="o">!</span><span class="p">()</span><span class="w"> </span><span class="c1">// comment in when using 3c.</span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</pre></div>


<p>error (with NLL enabled):</p>
<div class="codehilite"><pre><span></span>error[E0621]: explicit lifetime required in the type of `wrap`
  --&gt; src/main.rs:14:21
   |
8  | fn to_arc&lt;&#39;a, B&gt;(wrap: &amp;OwnedWrap&lt;B&gt;) -&gt; Arc&lt;B&gt;
   |                  ---- consider changing the type of `wrap` to `&amp;&#39;a OwnedWrap&lt;B&gt;`
...
14 |         let _: &amp;B = (*owned).borrow(); // (3b)
   |                     ^^^^^^^^^^^^^^^^^ lifetime `&#39;a` required

error: aborting due to previous error
</pre></div>



<a name="130717195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130717195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130717195">(Aug 01 2018 at 14:21)</a>:</h4>
<p>The smaller cases look unnatural, because they require <code>'a</code> as lifetime parameter while it does not appear in parameter list.<br>
But in original case, <code>'a</code> is used for the type to be impl'ed, and <code>B: 'a</code> is absolutely necessary.</p>



<a name="130757837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130757837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130757837">(Aug 02 2018 at 04:23)</a>:</h4>
<p>I've forgotten replacing <code>(*owned).borrow()</code> with <code>owned.borrow()</code>, but both emits the same error: <a href="https://play.rust-lang.org/?gist=ff33de12788eab2c1bdc8b39f2ea6b7f&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=ff33de12788eab2c1bdc8b39f2ea6b7f&amp;version=nightly&amp;mode=debug&amp;edition=2015">https://play.rust-lang.org/?gist=ff33de12788eab2c1bdc8b39f2ea6b7f&amp;version=nightly&amp;mode=debug&amp;edition=2015</a></p>



<a name="130974857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974857">(Aug 06 2018 at 12:16)</a>:</h4>
<p><span class="user-mention" data-user-id="123879">@YOSHIOKA Takuma</span> it seems like there might be some bugs lurking here</p>



<a name="130974875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974875">(Aug 06 2018 at 12:16)</a>:</h4>
<p>I'm looking now at the where clause <code>&amp;'a B: Into&lt;Arc&lt;B&gt;&gt;</code></p>



<a name="130974881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974881">(Aug 06 2018 at 12:17)</a>:</h4>
<p>adding that causes it not to compile, it seems -- tbh, that's always been an area where the compiler is weak</p>



<a name="130974889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974889">(Aug 06 2018 at 12:17)</a>:</h4>
<p>(e.g., where clauses for "generic" types like <code>&amp;u32</code>)</p>



<a name="130974906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974906">(Aug 06 2018 at 12:17)</a>:</h4>
<p>but I'm not sure I understand where the <code>Into</code> trait even comes into play here</p>



<a name="130974968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130974968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130974968">(Aug 06 2018 at 12:18)</a>:</h4>
<p>oh, wait, the where clauses causes a problem with or without NLL it seems</p>



<a name="130977917"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130977917" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130977917">(Aug 06 2018 at 13:16)</a>:</h4>
<p>Yes, in (1a)+(2a)+(3b) case, NLL causes different result (compilation success or error).<br>
In other cases (without (1b) and (2b)), it always fails to compile with and without NLL, but I can't believe they should be error.<br>
So I am wondering whether the compilation failure should be fixed, or it is intended behavior (that won't be "fixed").</p>



<a name="130978018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130978018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130978018">(Aug 06 2018 at 13:18)</a>:</h4>
<p>probably somewhere in between... "won't be fixed now"</p>



<a name="130978034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130978034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130978034">(Aug 06 2018 at 13:18)</a>:</h4>
<p>still we ought to file some bugs at least for the cases where NLL diverges</p>



<a name="130978037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130978037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130978037">(Aug 06 2018 at 13:18)</a>:</h4>
<p>and we can decide how to classify</p>



<a name="130978044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130978044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130978044">(Aug 06 2018 at 13:19)</a>:</h4>
<p>it would be helpful if you could file not one issue but multiple :)</p>



<a name="130978191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/130978191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#130978191">(Aug 06 2018 at 13:21)</a>:</h4>
<p>Ok, I'll file issues on GitHub later.<br>
Thank you.</p>



<a name="131042644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/131042644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> YOSHIOKA Takuma <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#131042644">(Aug 07 2018 at 13:00)</a>:</h4>
<p><code>Borrow::borrow()</code> causes compile error with NLL, but compiles without NLL · Issue <a href="https://github.com/rust-lang/rust/issues/53151" target="_blank" title="https://github.com/rust-lang/rust/issues/53151">#53151</a> · rust-lang/rust<br>
<a href="https://github.com/rust-lang/rust/issues/53151" target="_blank" title="https://github.com/rust-lang/rust/issues/53151">https://github.com/rust-lang/rust/issues/53151</a><br>
Unused trait bound with lifetime causes compile error · Issue <a href="https://github.com/rust-lang/rust/issues/53156" target="_blank" title="https://github.com/rust-lang/rust/issues/53156">#53156</a> · rust-lang/rust<br>
<a href="https://github.com/rust-lang/rust/issues/53156" target="_blank" title="https://github.com/rust-lang/rust/issues/53156">https://github.com/rust-lang/rust/issues/53156</a></p>
<p>Filed.</p>



<a name="131042677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/131042677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#131042677">(Aug 07 2018 at 13:01)</a>:</h4>
<p>thank you</p>



<a name="131043808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/131043808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#131043808">(Aug 07 2018 at 13:20)</a>:</h4>
<p>both are sort of "dups", but the NLL one is clearly actionable..</p>



<a name="131043827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/131043827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#131043827">(Aug 07 2018 at 13:21)</a>:</h4>
<p>I guess that <a href="https://github.com/rust-lang/rust/issues/51356" target="_blank" title="https://github.com/rust-lang/rust/issues/51356">#51356</a> argues for a slightly more general fix than the hackiest of hacks I had considered</p>



<a name="131043832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122657-t-compiler/wg-nll/topic/mysterious%20code%3A%20borrowed%20value%20seems%20to%20live%20too%20long/near/131043832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/122657-t-compiler/wg-nll/topic/mysterious.20code.3A.20borrowed.20value.20seems.20to.20live.20too.20long.html#131043832">(Aug 07 2018 at 13:21)</a>:</h4>
<p>since it seems like it is also related to <code>Into</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>